package com.wc.AlgoOJ_train.train1.c5.A403;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/8 10:56
 * @description 神、上帝以及老天爷
 * http://43.138.190.70:8888/p/A403
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int c = sc.nextInt();
        long[] dp = new long[21];
        double[] div = new double[21];
        div[1] = 1;
        div[2] = 2;
        dp[0] = 0;
        dp[1] = 0;
        dp[2] = 1;
        for (int i = 3; i <= 20; i++) {
            dp[i] = (i - 1) * (dp[i - 2] + dp[i - 1]);
            div[i] = div[i - 1] * i;
        }
        while (c-- > 0) {
            int n = sc.nextInt();
            double ans = round(dp[n] / div[n], 4) * 100;
            System.out.printf("%.2f%%\n",ans);
        }
    }

    public static double round(double m, double n) {
        double rad = Math.pow(10, n);
        m = m * rad;
        return Math.round(m) / rad;
    }
}
